/**
 * Description: 全局loading
 *
 * Created by hrx on 2023/9/18
 */
import { ElLoading } from 'element-plus'

const options = {
  lock: true,
  text: '疯狂加载中…',
  background: 'rgba(0, 0, 0, 0.7)',
}

let loadingInstance: { close: () => void; };

export function startLoading (): void {
  loadingInstance = ElLoading.service(options)
}

export function endLoading(): void {
  loadingInstance.close();
}
